<!DOCTYPE html>
<html>
<head>
	<title>sieve suanfa</title>
	<script src="sieve.js" type="text/javascript"></script>
	<script type="text/javascript">
		window.onload = function(){
			btn_n.onclick = function(){
				var i = parseInt(n.value);
				if(isNaN(i))
					result.innerHTML = "must input a number";
				else if(i <= 0)
					result.innerHTML = "must input + number";
				else{
					var start = new Date().getTime();
					var max_p = sieve(i);
					var spend = new Date().getTime() - start;
					result.innerHTML = "max_p is : " + max_p + "(take " + spend + "ms)";
				}
			}
		}
	</script>
	<style type="text/css">
		#result{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
<h1>Sieve Suanfa</h1>
<label for="n">input n : </label>
<input type="text" id="n" />
<input type="button" id="btn_n" value="ret max p" />
<label id="result"></label>
</body>
</html>